.tableToolBar {
  display: inline-flex;
  padding: @padding-xs;
  padding-bottom: 0;
}

.required-table-title .surely-table-header-cell-title-inner::before {
  margin: 0 4px;
  color: red;
  content: '*';
}

.surely-table-header-container {
  .surely-table-fix-left,
  .surely-table-fix-right {
    background-color: transparent;
  }
}

.table-wrapper {
  flex: 1 0 0;
  height: 100%;
  padding: @padding-xs;
  display: flex;
  flex-direction: column;
  background: #fff;

  .surely-table-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 0 0;
  }

  .surely-table-wrapper.ant-spin-nested-loading,
  .ant-spin-container {
    height: 100%;

    &.ant-spin-container {
      display: flex;
      flex-direction: column;

      .surely-table {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        width: 100%;
        height: 100% !important;
      }
    }

    .surely-table-body {
      flex: 1 1 0;
      max-height: initial !important;

      .surely-table-fix-left,
      .surely-table-fix-right {
        background-color: #fff;
      }
    }
  }

  .ant-pagination-slash {
    transform: rotate(-20deg);
    display: inline-block;
    margin: 0 10px 0 0;
  }
}

.table-wrapper {
  .surely-table-header-cell-title {
    font-weight: 600;
  }
  .surely-table-wrapper-bordered .surely-table-pagination {
    border: 1px solid @table-border-color;
  }
  .surely-table-has-animate .surely-table-row {
    transition: none;
  }

  .surely-table.surely-table-stripe .surely-table-body .surely-table-row-odd:not(.surely-table-row-selected, .surely-table-row-hover) {
    background: #f7f8fa;
  }

  .surely-table-bordered .surely-table-empty-container {
    border: 0;
  }

  .ant-pagination-options-size-changer.ant-select {
    font-size: @font-size-base;
  }

  .surely-table-bordered {
    border-right: 1px solid @table-border-color;
  }

  .surely-table-bordered .surely-table-header-scrollbar,
  .surely-table-bordered .surely-table-summary-scrollbar {
    border-right: 0;
  }

  .ant-table-wrapper {
    height: 100%;
  }

  .ant-table-thead > tr > th {
    font-weight: 600;
    border-bottom-width: 2px;
  }

  .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner {
    margin-top: -0.35em;
    margin-left: 0.3em;
  }

  // 表格分页样式
  .surely-table-wrapper {
    .ant-pagination-simple .ant-pagination-simple-pager input {
      width: 36px;
      border: 1px solid @layout-body-background;
    }

    .ant-pagination {
      position: relative;
      z-index: 11;
      display: flex;
      flex: 0 0 40px;
      float: initial;
      margin: 0;
      padding: 8px 36px 8px 0;
      font-size: @font-size-base;
      text-align: right;
      background: #fff;
      // border: 1px solid @table-border-color;
      border-top: 0;

      .ant-select:hover:has(.ant-select-selection-item) .ant-select-arrow {
        right: 12px;
      }

      .ant-pagination-total-text {
        margin-right: auto;
        margin-left: 8px;
      }

      .ant-pagination-prev,
      .ant-pagination-next,
      .ant-pagination-item:not(.ant-pagination-item-active),
      .ant-pagination-item:not(.ant-pagination-item-active) {
        background-color: @layout-body-background;
        border-color: @layout-body-background;
      }

      .ant-pagination-prev,
      .ant-pagination-next,
      .ant-pagination-prev .ant-pagination-item-link,
      .ant-pagination-next .ant-pagination-item-link {
        background-color: transparent;
        border-color: transparent;
      }

      .ant-pagination-item-link,
      .ant-pagination-item {
        // border: 0;
      }

      .ant-pagination-options-quick-jumper,
      .ant-pagination-total-text,
      .ant-select-selection__rendered {
        height: 24px;
        line-height: 22px;
      }

      .ant-pagination-options {
        .ant-select-selection--single {
          height: 24px;
          line-height: 24px;
          background-color: @layout-body-background;
          border-color: @layout-body-background;
        }

        .ant-pagination-options-quick-jumper input {
          height: 24px;
          line-height: 24px;
          background-color: @layout-body-background;
          border-color: @layout-body-background;
        }
      }

      .ant-pagination-prev,
      .ant-pagination-next,
      .ant-pagination-jump-prev,
      .ant-pagination-jump-next,
      .ant-pagination-item,
      .ant-select-selector,
      .ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input,
      .ant-select-single .ant-select-selector .ant-select-selection-item,
      .ant-select-single .ant-select-selector .ant-select-selection-placeholder {
        min-width: 24px;
        height: 24px;
        margin: 0 2px;
        line-height: 22px;
        flex: none;
      }

      .ant-select-item-option-content {
        text-align: left;
      }

      .ant-pagination-item-active a {
        color: #fff;
        height: 100%;
        background: @primary-color;
      }

      .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
        background-color: @layout-body-background;
        border-color: @layout-body-background;
      }
    }
  }

  // 无数据
  .surely-table-empty-container {
    padding: 0;
    border: 0;

    > div {
      height: 100%;

      .ant-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        margin: 0;
      }
    }
  }

  // .surely-table-body-container {
  //   height: 100% !important;
  // }

  .surely-table-bordered .surely-table-extra-cell,
  .surely-table-bordered .surely-table-header-extra-cell,
  .surely-table-bordered .surely-table-cell-group {
    border-right: 1px solid @table-border-color;
  }

  .surely-table-cell-content:empty {
    &::after {
      content: '--';
      display: block;
      color: @text-color-less;
    }
  }

  // 表格内控件样式
  .surely-table-checkbox-inner {
    border-radius: @border-radius-base;
  }

  .surely-table-cell-inner {
    align-items: center;

    .surely-table-row-indent + .surely-table-row-expand-icon {
      margin-right: 8px;
    }

    .surely-table-cell-content > .avic-icon {
      position: relative;
      z-index: 2;
      margin-right: 4px;

      .svg-icon {
      }
    }

    .surely-table-append-node {
      flex: none;
    }

    .ant-btn-link {
      height: auto;
      padding: 0 8px 0 0;
      margin-right: 8px;
      line-height: 14px;
      border: 0;
      border-radius: 0;
      outline: none;
    }

    .ant-btn-link:not(:last-child) {
      border-right: 1px solid @table-border-color;
    }

    .ant-tag:last-child {
      margin: 0;
    }
  }

  .surely-table-row-expand-icon {
    border: 1px solid #b8c1cb;
    transform: none;
    width: 17px;
    height: 17px;
    border-radius: 2px;
    z-index: 4;
    background-color: #fff;
    &::after {
      left: 7px;
    }

    &::before {
      top: 7px;
    }
  }

  // 表格换肤
  .surely-table-cell-inner {
    overflow: initial;
  }

  .surely-table-checkbox:hover .surely-table-checkbox-inner,
  .surely-table-checkbox-input:focus + .surely-table-checkbox-inner,
  .surely-table-checkbox-checked::after {
    border-color: @primary-color;
  }

  .surely-table-checkbox-checked .surely-table-checkbox-inner {
    background: @primary-color;
    border-color: @primary-color;
  }

  .surely-table-checkbox-indeterminate .surely-table-checkbox-inner::after {
    background: @primary-color;
  }

  .surely-table-checkbox-disabled .surely-table-checkbox-inner {
    background: #f5f5f5;
  }

  .surely-table-column-sorter {
    margin-left: 4px;
  }
}

.advanced-table {
  background-color: #fff;

  .tableRefresh {
    position: absolute;
    right: 6px;
    bottom: 8px;
    z-index: 22;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #eff0f2;
    border-radius: 2px;

    span {
      color: @primary-color;
    }
  }

  .tableRefresh:hover {
    background: @primary-color;

    span {
      color: #fff;
    }
  }

  .header-bar {
    display: flex;
    flex: 0;
    align-items: center;
    padding: 0;
    border-radius: 4px;
    transition: all 0.3s;

    & > .toolBarLeft .ant-space {
      gap: 0 !important;

      .ant-btn {
        margin-right: 8px;
      }
    }

    & > .toolBarRight .ant-space {
      gap: 0 !important;

      .ant-space-item:not(:last-child) {
        .ant-btn:not(.ant-input-search-button) {
          margin-right: 8px;
        }
      }
    }

    .title {
      font-weight: 700;
      font-size: 16px;
    }

    .search {
      flex: 1;
      margin: 0 8px;
      text-align: right;
    }

    .actions {
      font-size: 17px;
      text-align: right;

      .action {
        margin: 0 8px;
        cursor: pointer;
      }
    }

    .ant-space-align-center {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
    }
  }

  .toolBarLeft {
    flex: 1;
    margin: 0;
    margin-bottom: 8px;
    text-align: left;
    // font-weight: 600;

    slot {
      display: block;
      padding: 8px 0 0 8px;
    }
  }

  .toolBarRight {
    flex: initial;
    margin-bottom: 8px;
    margin-left: auto;
    text-align: right;

    slot {
      display: block;
      padding: 8px 8px 0 0;
    }
    //表格右上角单选按钮组样式
    .ant-radio-group-solid {
      padding: 0px;
      background: #f0f2f5;
      border-radius: 4px;
      padding: 2px;
      margin-right: 8px;
      .ant-radio-button-wrapper {
        height: 28px;
        line-height: 26px;
        padding: 0px 16px;
        border: 1px solid transparent;
        border-radius: 4px;
        background: transparent;
        font-size: 14px;

        &:not(:first-child)::before {
          display: none;
        }
      }

      .ant-radio-button-wrapper-checked {
        color: @primary-color;
        background: #ffffff;
        border-color: @border-color-fill;
        font-weight: 600;
        box-shadow: 0 1px 2px 0 rgba(7, 35, 53, 0.12) !important;
      }
    }
    .ant-radio-button-wrapper {
      padding: 0 8px;
    }
  }

  .tableSelection {
    position: absolute;
    bottom: 14px;
    left: 8px;
    min-width: 90px;
    z-index: 22;
    padding-right: 4px;
    margin-right: 8px;
    font-size: @font-size-base;
    line-height: 12px;
    text-align: left;
    border-right: 1px solid @table-border-color;
  }

  .tableSelectionTotal {
    position: absolute;
    bottom: 8px;
    z-index: 22;
    height: 12px;
    font-size: @font-size-base;
    line-height: 12px;
    text-align: left;
    padding-left: 108px;
  }

  .tableSelectionTotalNoSelection {
    padding-left: 10px;
  }
}

// 表格没数据时高度也要能撑开
.advanced-table,
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-content,
.ant-table-scroll,
.ant-table-placeholder {
  // height: 100%;
  // width: 100%;
  //处理奇安信兼容问题
  flex: 1 0 0;
  display: flex;
  flex-direction: column;
}

.inner-table-wrapper {
  position: relative;
  flex: 1 0 0;
  min-height: 100px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inner-table-wrapper .ant-table-empty .ant-table-placeholder {
  position: absolute;
  top: 50px;
  right: 8px;
  left: 8px;
  height: calc(100% - 60px);
  padding: 0;
  overflow: auto;
  background: transparent;
  border: 0 !important;
}

// 树表格样式
.advanced-table.tree-grid .surely-table .surely-table-cell-content {
  padding-left: 4px;
}

.treeGridLineClass {
  position: relative;

  .line-ver {
    position: absolute;
    bottom: 50%;
    left: -32px;
    z-index: 2;
    width: 5px;
    height: 1px;
    border-top: 1px solid #b8c1cb;
  }

  .line-hor {
    position: absolute;
    bottom: 50%;
    left: -34px;
    z-index: 2;
    width: 1px;
    height: 40px;
    border-left: 1px solid #b8c1cb;
  }
}

.surely-table-row-expand-icon {
  position: relative;
  z-index: 99;
}

.tableTreeLine {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 100px;
  border-left: 1px solid #b8c1cb;
}

.firstNodeClass {
  .tableTreeLine {
    height: 50%;
  }

  .line-hor {
    height: 0;
  }
}

.tableCustomPage.ant-pagination {
  bottom: 0;
}

.tableCustomPage {
  position: absolute;
  right: 40px;
  bottom: 8px;
  z-index: 22;
  height: 24px;
  line-height: 24px;
  display: flex;
  line-height: 22px;
  align-items: center;

  input {
    background-color: #f2f3f5;
    border-color: #f2f3f5;
    line-height: 22px;
  }

  button {
    background-color: #f2f3f5;
    border-color: #f2f3f5;
    line-height: 22px;
    margin-right: 4px;
  }
}

.customPageClass {
  .surely-table-wrapper .ant-pagination {
    padding-right: 230px;
    left: 0;
  }

  .surely-table-wrapper .ant-pagination-simple {
    padding-left: 68px;
  }
}

.has-rowSelection {
  .surely-table-wrapper .ant-pagination .ant-pagination-total-text {
    padding-left: 108px;
  }
}

.table-card-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;

  .surely-table-wrapper {
    display: flex;
    overflow: auto;
    overflow-x: hidden;

    .ant-checkbox-group {
      padding: 0;

      .ant-checkbox-wrapper {
        position: absolute;
        right: 12px;
        top: 10px;
        margin: 0;

        .ant-checkbox {
          .ant-checkbox-inner {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background-color: #f0f2f5;
            border: 0;

            &::after {
              left: 26%;
              top: 46%;
              position: absolute;
              display: table;
              border: 2px solid #86909c;
              border-top: 0;
              border-left: 0;
              transform: rotate(45deg) scale(1) translate(-50%, -50%);
              opacity: 1;
              transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
              content: ' ';
            }
          }
        }

        .ant-checkbox-checked {
          .ant-checkbox-inner {
            background-color: @primary-color;
            display: block;

            &::after {
              border-color: #fff;
            }
          }
        }
      }

      .ant-card {
        height: 100%;
        display: flex;
        flex-direction: column;

        &:hover {
          .ant-checkbox-inner {
            display: block;
          }
        }

        .add-card-inner {
          display: flex;
          align-items: center;
          justify-content: center;
          flex-direction: column;
          height: 100%;
        }

        .ant-card-head {
          border: 0;
          padding-right: 40px;

          .card-title-box {
            display: flex;
            align-items: center;

            h4 {
              margin: 0;
              text-overflow: ellipsis;
              white-space: nowrap;
              overflow: hidden;
              line-height: 1.5;
            }
          }
        }

        .ant-card-extra {
          padding: 0;

          .ant-btn-link {
            padding: 0;
          }
        }

        .ant-card-body {
          flex: 1 0 0;
          padding-top: 0;

          p {
            margin: 0.3em 0;
          }
        }

        .ant-card-actions {
          background: transparent;
          background-color: @card-head-background;
          border-radius: 0 0 @card-radius @card-radius;

          & > li:not(:last-child) {
            border: 0;
          }
        }
      }
    }
  }
}
// 表头文字间距
.surely-table .surely-table-cell {
  .surely-table-cell-box {
    padding: 0 6px;
  }
}
//自适应表格高度
.table-wrapper.auto-height-table {
  .surely-table {
    height: 300px !important;
  }
  &.table-wrapper .surely-table-body {
    flex: 1;
    max-height: 300px !important;
  }
  .inner-table-wrapper {
    flex: none;
    min-height: initial;
  }

  .surely-table-empty-container {
    border-bottom: 0;
    height: 160px;
  }
}

.surely-table-cell-inner {
  overflow: initial;
}
